package httpd

import "io"

type Bucket struct {
	Name         string `json:"name" xml:"Name"`
	CreationDate string `json:"creationDate" xml:"CreationDate"`
}

type CompleteMultipartUpload struct {
	PartETags []PartETag `json:"partETags" xml:"PartETags"`
}

type CompleteMultipartUploadResult struct {
	BucketName string `json:"bucketName" xml:"BucketName"`
	ObjectKey  string `json:"objectKey" xml:"ObjectKey"`
	ETag       string `json:"eTag" xml:"ETag"`
}

type InitiateMultipartUploadResult struct {
	Bucket    string `json:"bucket" xml:"Bucket"`
	ObjectKey string `json:"objectKey" xml:"ObjectKey"`
	UploadId  string `json:"uploadId" xml:"UploadId"`
}

type ListBucketsResult struct {
	Buckets []Bucket `json:"buckets" xml:"Buckets"`
}

type ObjectMetadata struct {
	ContentType   string `json:"contentType"`
	ContentLength int64  `json:"contentLength"`
	LastModified  string `json:"lastModified"`
	FileName      string `json:"fileName"`
}

type PartETag struct {
	PartNumber int    `json:"partNumber" xml:"PartNumber"`
	ETag       string `json:"eTag" xml:"ETag"`
}

type S3Object struct {
	BucketName string         `json:"bucketName"`
	Key        string         `json:"key"`
	Metadata   ObjectMetadata `json:"metadata"`
	ObjectData io.Reader      `json:"-"`
}

type UploadFileResp struct {
	ETag         string `xml:"ETag"`
	LastModified string `xml:"LastModified"`
}

type BucketWrapper struct {
	Bucket Bucket `xml:"Bucket"`
}

type Owner struct {
	DisplayName string `xml:"DisplayName"`
}
type ListBucketResp struct {
	Id      string          `xml:"Id"`
	Owner   Owner           `xml:"Owner"`
	Buckets []BucketWrapper `xml:"Buckets"`
}
